package com.desire.utils;

import java.time.LocalDate;

/**
 * @author LittleDesire
 * @description
 * @date 2022-05-21 周六 17:30
 * @since 17
 */
public class DateUtils {
    /**
     * @return 获取当前年份
     */
    public static String getYear() {
        LocalDate date = LocalDate.now();
        int year = date.getYear();
        return String.valueOf(year);
    }

    public static String getYearMonth() {
        LocalDate date = LocalDate.now();
        int year = date.getYear();
        int month = date.getMonthValue();
        int day = date.getDayOfMonth();
        return String.format(year + "%02d%02d", month, day);
    }
}
